@echo off
setlocal enabledelayedexpansion
chcp 65001

set cpp_files=


for /r %%f in (*.cpp) do (
    set cpp_files=!cpp_files! %%f
)


set cpp_files=%cpp_files:~1%


g++ %cpp_files% -o main.exe

if %errorlevel% equ 0 (
    echo failed
) else (
    echo success
)

pause    